<?php
//创建server对象，监听 9001端口 类型为SWOOLE_SOCK_UDP
$server = new swoole_server("127.0.0.1", 9001, SWOOLE_PROCESS, SWOOLE_SOCK_UDP);

$server->on('Packet', function($server, $data, $clientInfo){
    $server->sendto($clientInfo['address'], $clientInfo['port'], "服务端" . $data);
    var_dump($clientInfo);
});

$server->start();